﻿function getQry(key) {
    var search = location.search.slice(1); //得到get方式提交的查询字符串
    var arr = search.split("&");
    for (var i = 0; i < arr.length; i++) {
        var ar = arr[i].split("=");
        if (ar[0] == key) {
            return ar[1];
        }
    }
}

function redirct(rehtml) {
    window.location.href = rehtml + "?personID=" + $("#txtPersonid").val();
}

function redirctQx(rehtml) {
    window.location.href = rehtml + "?personID=" + $("#txtPersonid").val();
}
function redirctLogin() {
    window.location.href ="Login.html";
}
function load() {

    try {
        var personID = getQry("personID");
        $("#txtPersonid").val(personID);
        if (personID.length > 0) {
            $('.tab').find('li').removeClass('visited'); $('.tab').find('li').eq(personID).addClass('visited');
            }
    } catch (e) { }
}
function redirctMain(rehtml, power) {
    window.location.href = rehtml + "?power=" + power;
 
}
function getPower() {

    try {
        var getPower = getQry("power");
        checkPower(getPower);
    } catch (e) { }
}
function checkPower(power) {
    switch (power) {
        case "1":
            $("#liaffairAcceptance").show();
            $("#liAcceptedPage").show();
            $("#lijbxxbd").show(); 
            break;
        case "2":
            $("#liStrVerifyIndex").show();
            break;
        case "3":
            $("#liCountyVerifyIndex").show();
            $("#liVerifyStopIndex").show();
            break;
        case "4":
            $("#liMunVerifyIndex").show();
            $("#liVerifyStopIndex").show();
            $("#liVerifyReportIndex").show();
            break;
        case "5":
            $("#liReport").show();
            $("#liManagerMain").show();
            $("#liMunVerifyIndex").hide();
            break;
        case "6":
            $("#liMunVerifyIndex").show();
            $("#liaffairAcceptance").show();
            $("#liAcceptedPage").show();
            $("#lijbxxbd").show(); 
            $("#liStrVerifyIndex").show();
            $("#liCountyVerifyIndex").show();
            $("#liVerifyStopIndex").show();
            $("#liVerifyReportIndex").show();
            $("#liReport").show();
            $("#liManagerMain").show();
            break;
        default:
            redirctLogin();
            break;
    }
}

function hideSendAffair(tableId) {
        $("#"+tableId+"").toggle(200);
   }